﻿@model Scap.Info.ScapDepartment

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>ScapDepartment</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <div style="display:none;">
            <div class="editor-label">
                @Html.LabelFor(model => model.TypeId, "Type")
            </div>
            <div class="editor-field">
                @*Html.DropDownList("TypeId", String.Empty)*@
                @Html.EditorFor(model => model.TypeId)
                @Html.ValidationMessageFor(model => model.TypeId)
            </div>
        </div>

        <div class="editor-label">
            @*Html.LabelFor(model => model.AddressId, "Address")*@
            <label>Dirección</label>
        </div>
        <div class="editor-field">
            @Html.DropDownList("AddressId", String.Empty)
@*            @Html.DropDownList("AddressId", (IEnumerable<SelectListItem>)ViewBag.AddressId, "Seleccionar Dirección", new { id = "addressIdselectorid" })*@
            <div style="display:none;">
                @Html.EditorFor(model => model.AddressId)
                @Html.ValidationMessageFor(model => model.AddressId)
            </div>        
        </div>

        <div class="editor-label">
@*            @Html.LabelFor(model => model.ParentDepartmentId, "ParentDepartment")*@
            <label>Padre</label>
        </div>
        <div class="editor-field">
            @Html.DropDownList("ParentDepartmentId", String.Empty)
            @Html.ValidationMessageFor(model => model.ParentDepartmentId)
        </div>

        <div class="editor-label">
@*            @Html.LabelFor(model => model.CompanyId, "Company")*@
            <label>Compañia</label>
        </div>
        <div class="editor-field">
            @Html.DropDownList("CompanyId", String.Empty)
            <div>
@*                @Html.EditorFor(model => model.CompanyId)*@
                @Html.ValidationMessageFor(model => model.CompanyId)
            </div>
        </div>

        <p>
            <input id="adicionarDeptoAreasubmitbtn" type="submit" value="Guardar" />
            &nbsp;
            <input id="adicionarDeptoAreaClosebtn" type="button" value="Cerrar" />
        </p>
    </fieldset>
}
<div id="deptoAreaIdHlp" style="display:none;">
    @ViewBag.deptoAreaIdHlp
</div>
